local ty_fancheng = fk.CreateSkill {
  name = "ty_fancheng",
  tags = { Skill.Limited },
  mode_skill = true,
}

Fk:loadTranslationTable{
  ["ty_fancheng"] = "樊城",
  [":ty_fancheng"] = "限定技，出牌阶段，你可以选择一项：1.本局游戏你使用【杀】对其他角色造成的伤害+1；2.本局游戏你使用【杀】以外的方式对其他角色造成的伤害+1。",

  ["ty_fancheng_slash"] = "【杀】伤害+1",
  ["ty_fancheng_else"] = "非【杀】伤害+1",
  ["#ty_fancheng-ask"] = "樊城：你可令你本局对其他角色造成【杀】的伤害或除【杀】以外的伤害+1",
  
  ["$ty_fancheng1"] = "沉白马以盟三军，此城即吾等埋骨之地！",
  ["$ty_fancheng2"] = "水势虽汹，安能淹我旌旗？援锋已至，随我裂阵！",
}

ty_fancheng:addEffect("active", {
  anim_type = "offensive",
  prompt = "#ty_fancheng-ask",
  interaction = function(self, player)
    local all_choices = { "ty_fancheng_slash", "ty_fancheng_else" }
    local choices = table.simpleClone(all_choices)
    return UI.ComboBox { choices = choices , all_choices = all_choices }
  end,
  card_num = 0,
  target_num = 0,
  can_use = function(self, player)
    return player:usedSkillTimes(ty_fancheng.name, Player.HistoryGame) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local choice = self.interaction.data
    room:setPlayerMark(player, "ty_fancheng", choice)
  end,
})

ty_fancheng:addEffect(fk.DamageCaused, {
  mute = true,
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    if target == player and data.to ~= player then
      local slash = (data.card and data.card.trueName == "slash")
      if (slash == true and player:getMark("ty_fancheng") == "ty_fancheng_slash") or
       (not slash == true and player:getMark("ty_fancheng") == "ty_fancheng_else") then
        return true
      else return false
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    data:changeDamage(1)
  end,
})

return ty_fancheng